#include <stdlib.h>
#include <iostream>
#include "Factory.h"

using namespace std;

void displayWindow1(Factory *factory)
{
    Widget* w[] = { factory->createButton(), factory->createMenu() };
    w[0]->draw();
    w[1]->draw();

    delete w[0];
    delete w[1];
}

void displayWindow2(Factory *factory)
{
    Widget* w[] = { factory->createMenu(), factory->createButton() };
    w[0]->draw();
    w[1]->draw();

    delete w[0];
    delete w[1];
}

int main(int argc, char** argv)
{
    Factory *factory = Factory::createFactory(WindowsPlatform);
    Widget *w = factory->createButton();
    w->draw();
    displayWindow1(factory);
    displayWindow2(factory);

    delete w;
    delete factory;

    return (EXIT_SUCCESS);
}

